/**
 * @param {number[]} ranks
 * @param {character[]} suits
 * @return {string}
 */
var bestHand = function (ranks, suits) {
  if ([...new Set(suits)].length === 1) return "Flush";

  let identicalNum = 1;

  ranks.forEach((e, index) => {
    let _identicalNum = 1;
    for (let i = index + 1; i < ranks.length; i++) {
      if (e === ranks[i]) {
        _identicalNum++;
        if (_identicalNum > identicalNum) {
          identicalNum = _identicalNum;
        }
      }
    }
  });

  if (identicalNum === 2) return "Pair";
  if (identicalNum > 2) return "Three of a Kind";

  return "High Card";
};
